home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / DF1DIM.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  549b  |  25 lines

  1. FUNCTION df1dim(x: real): real;
  2. (* Programs using routine DF1DIM must define the type
  3. TYPE
  4.    glnarray = ARRAY [1..n] OF real;
  5. They must also define the variables
  6. VAR
  7.    ncom: integer;
  8.    pcom,xicom: glnarray
  9. in the main routine, and externally assign them values. *)
  10. VAR
  11.    df1: real;
  12.    j: integer;
  13.    xt,df: glnarray;
  14. BEGIN
  15.    FOR j := 1 TO ncom DO BEGIN
  16.       xt[j] := pcom[j]+x*xicom[j]
  17.    END;
  18.    dfunc(xt,df);
  19.    df1 := 0.0;
  20.    FOR j := 1 TO ncom DO BEGIN
  21.       df1 := df1+df[j]*xicom[j]
  22.    END;
  23.    df1dim := df1
  24. END;
  25.